package edu.sctu.alex.projectPratice.subwaysystem.until;

import edu.sctu.alex.projectPratice.subwaysystem.appbean.PeopleAppbean;
import edu.sctu.alex.projectPratice.subwaysystem.data.SetPeopleData;
import edu.sctu.alex.projectPratice.subwaysystem.data.SetTrainData;

/**
 * Created by user03 on 2015/6/3.
 */
public class JudgePeopleInfo {

    public void jugePeopleInfo(){
        PeopleAppbean people = new SetPeopleData().setPeopleData().get(0);

        if (people.isCard()) {
            if (new CheckMethods(people).chaBaoGuo()) {
                System.out.println("包裹有违禁品");
            } else {
                if (new CheckMethods(people).chaWater()) {
                    System.out.println("水有问题");
                } else {
                    if (people.getCardMoneey() > 2) {
                        System.out.println("进站");
                    } else {
                        new CardMethods().setPrice(10, people);
                        System.out.println("充值成功");
                    }
                    if (people.getCardMoneey() >= new CardMethods().getPrice(
                            people.getStarStation(), people.getEndStation())) {
                        System.out.println("出站,余额为:"
                                + (people.getCardMoneey() - new CardMethods().getPrice(
                                people.getStarStation(), people.getEndStation())));
                    } else {
                        new CardMethods().setPrice(10, people);
                        System.out.println("充值成功");
                    }
                }

            }
        } else {
            System.out.println("买票");
            if (new CheckMethods(people).chaBaoGuo()) {
                System.out.println("包裹有违禁品");
            } else {
                if (new CheckMethods(people).chaWater()) {
                    System.out.println("水有问题");
                } else {
                    System.out.println("出站");
                }
            }
        }

    }

    public void judgeThief(){
        SetTrainData setTrainData = new SetTrainData();

        if(setTrainData.setthief()){
            System.out.println("有贼，请相关部门出动");

        }else {
            System.out.println("环境安全，请放心出行");

        }

    }

    public void judgeProblem(){
        SetTrainData setTrainData = new SetTrainData();
        if(setTrainData.setProblem()){
            System.out.println("出现问题，请相关部门出动");

        }else {
        System.out.println("安全，请放心出行");

        }

    }
}
